package management;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class AddTip extends JFrame {
    public AddTip() {
        setSize(200, 150);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setLayout(new BorderLayout());
        JLabel successLabel = new JLabel("信息添加成功！", SwingConstants.CENTER);
        successLabel.setFont(new Font("宋体", Font.BOLD, 16));
        JButton okButton = new JButton("确定");
        okButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                // 点击确定按钮时关闭窗口
               setVisible(false);
            }
        });
        add(successLabel, BorderLayout.CENTER);
        add(okButton, BorderLayout.SOUTH);
        setVisible(true);
    }

}
